<extend name="Index/base"/>
<block name="main">
    <section class="section main">
        <div class="clearfix con-main" id="mainContainer">
            <div class="con-left">
                <div class="panel">
                    <div class="panel-header">
                        <h3 class="panel-title bbs-title">{$user.nick}</h3>
                    </div>
                    <div class="panel-body">
                        <div class="bbs-info">
                            <a class="photo bbs-photo" href="//wooo.wang/u/{$user.id}"><img src="{$user.avatar}"></a>
                            <p><strong>{:formatCount($user['visit'])}</strong> 浏览 • <strong>{$user.gx}</strong> 贡献度</p>
                            <p>{$user.desc|default='我好像什么都没写...'}</p>
                            <p class="handle"><if condition="$auth"><a class="handle-donation" href="{:U('/setUser')}">设置</a><elseif condition="UID"/><a id="donationBtn" class="handle-donation" href="javascript:void(0)">打赏</a><else/><a class="handle-donation" href="javascript:alert('您需要先登录账号')">打赏</a></if></p>
                        </div>
                    </div>
                </div>
                <div class="panel" id="siderBox">
                    <ul class="switch-section">
                        <li><a href="{:U('/u/'.$user['id'])}"><span class="icon-a"></span> 个人信息</a></li>
                        <li><a href="{:U('/collect/'.$user['id'])}" class="red"><span class="icon-star"></span> 收藏文档<span class="count green">「{$collets|default=1}」</span></a></li>
                        <li><a href="{:U('/review/'.$user['id'])}"><span class="icon-eye"></span> 审阅记录</a></li>
                        <if condition="$login eq 1">
                            <li><a href="{:U('/msg')}"><span class="icon-msg"></span> 通知消息<if condition="$mcount gt 0"><span class="count red">「{$mcount}」</span></if></a></li>
                            <li><a href="{:U('/log')}"><span class="icon-docu"></span> 贡献日志</a></li>
                            <li><a href="{:U('/createBbs')}"><span class="icon-add"></span> 创建社区</a></li>
                            <li><a href="{:U('/createDoc')}"><span class="icon-add"></span> 创建私有文档</a></li>
                            <li><a href="{:U('/setUser')}"><span class="icon-setting"></span> 设置账号信息</a></li>
                            <li><a href="{:U('/logout@wooo.wang')}"><span class="icon-out"></span> 退 出</a></li>
                            <elseif condition="UID"/>
                            <li><a href="{:U('/u/'.UID)}"><span class="icon-left"></span> 返回个人中心</a></li>
                        </if>
                    </ul>
                </div>
            </div>
            <div class="con-right">
                <div class="panel other">
                    <div class="panel-header">
                        <h1 class="topic-title">收藏文档<span class="icon-sum" id="toggleBtn" onclick="$('#mainContainer').toggleClass('toggle-side-mark');"></span></h1>
                        <p class="topic-info">
                            <a href="//wooo.wang/u/{$user['id']}">{$user['nick']}</a> • 展示该用户收藏的所有文档！
                        </p>
                    </div>
                    <div class="panel-body">
                        <ul class="doc-lists">
                            <volist name="list" id="vo">
                                <li>
                                    <a href="//doc.wooo.wang/show/{$vo['id']}" class="con-cover"><img src="//img.wooo.wang/{$vo.img}" title="{$vo.name}"></a>
                                    <div class="con-book-info">
                                        <h3><a href="//doc.wooo.wang/show/{$vo['id']}">{$vo.name}
                                            <if condition="$vo.status eq -1">
                                                <span class="red"> 「冻结中」</span>
                                            <elseif condition="$vo.status eq 1"/>
                                                <span class="green"> 「隐藏中」</span>
                                            </if>
                                        </a></h3>
                                        <p>{$vo.desc}</p>
                                        <div class="con-book-footer">
                                            <span class="icon-star" title="收藏数"></span> {$vo.collect} &nbsp;<span class="icon-pencil" title="修改次数"></span> {$vo.change} &nbsp;<span class="icon-time" title="创建时间"></span> {$vo.create|date="Y-m-d",###}
                                        </div>
                                    </div>
                                </li>
                            </volist>
                            {$page}
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <if condition="UID and !$auth">
            <div class="modal hide" id="modal">
                <div class="modal-container" style="max-width:400px;margin-top:20%;">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button class="modal-close" id="modalClose"><span>&times;</span></button>
                            <h4 class="modal-title">捐赠贡献度</h4>
                        </div>
                        <div class="modal-body">
                            <div class="form">
                                <div class="form-item">
                                    <input type="number" name="gx" id="gxInput" data-gx="{$gx}" min="1" max="{$gx}" placeholder="请填写您捐赠的贡献度...">
                                </div>
                            </div>
                            <p class="edit-tip">您当前拥有 <strong class="red" id="userAllGx">{$gx}</strong> 点贡献度...</p>
                        </div>
                        <div class="modal-footer">
                            <button class="modal-no" id="modalNo">取消</button>
                            <button class="modal-save no-save" id="modalOk" data-url="/user/donation/uid/{$user['id']}">确认</button>
                        </div>
                    </div>
                </div>
            </div>
        </if>
    </section>
</block>
<block name="js">
    <script src="__STATIC__/doc/js/donation.js?v=__VERSION__"></script>
</block>
